﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Data.cs" company="DissingNelleman">
//   
// All rights reserved. </copyright>
// <summary>
//   The data.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ServiceLibrary.Models.Base
{
    using NHibernate.Mapping.ByCode.Conformist;

    /// <summary>
    /// The data.
    /// </summary>
    public class Data : Entity
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        public virtual byte[] Content { get; set; }

        #endregion
    }

    /// <summary>
    /// The data mapping.
    /// </summary>
    public class DataMapping : ClassMapping<Data>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="DataMapping"/> class.
        /// </summary>
        public DataMapping()
        {
            this.Property(x => x.Content, m => m.Length(int.MaxValue / 2));
        }

        #endregion
    }
}